The trigger is one of HelpDesk automation tools. A lot of default triggers are available out of the box. The default triggers send notifications to agents and requesters about significant events: for example, there is a trigger that notifies your clients about a new reply on the ticket:
Whenever a new comment is added, HelpDesk runs the trigger. Then it checks the condition rule i.e. whether the added comment is not initial and is a reply. If it is true, the trigger sends notifications to the requester and CC contacts. Trigger settings define when to run the trigger, what conditions to check and what actions to perform. You can create triggers for other cases, more about this in further sections of the article.
Let’s create a trigger that will assign sales tickets to a specified agent and tag them accordingly.
Open HelpDesk settings:
Go to the Triggers tab and create a new trigger.
General properties overview:
Active
, it defines whether HelpDesk will run the trigger on a specified event; use this option to temporarily disable some triggers;
Record runs in ticket history
, it adds a record to the History tab of a ticket form if trigger actions were performed on its basis;
Title
, a name to identify the trigger on the list;
Set the general parameters as follows:
The Execute when field contains possible events within your HelpDesk site that can start the trigger. Their names are self-explanatory:
Ticket was created
, a new item on the “Tickets” list is created;
Ticket has been changed
, an item on the “Tickets” list is modified;
Comment has been created
, a new comment in the existing ticket is created.
For the current case, I select the event Ticket was created
.
The trigger will execute the specified actions only if conditions are true. You can combine them with logical operators AND/OR, select ticket or comment fields on one side, and enter custom values on the other. It is possible to build more complex conditions using functions and regular expressions. Review the article Building advanced conditions for more information.
Let’s check whether the title of a newly created ticket contains such keywords as Quote
or Invoice
to define it as a sales ticket.
Select [Ticket.Title]
in the left dropdown and type the keywords in the right part of each condition.
The custom strings should be enclosed in single quotes for proper processing.
Also, set the operator to contains
, pay attention that it is case-sensitive.
The main point of any trigger is to perform some actions. There can be as many actions as you need, and they can be arranged in the order you want. To add one, just click Add action.
There are three types of available actions:
Set field, the action assigns a value to the selected field of a ticket;
Send email, the action sends an e-mail message based on a template that is filled with ticket data;
Change comment type to private, if the trigger was started on comment creation, then you can change its type to private.
For more information on the actions, check the article Actions reference.
In this example, we assign a ticket to a certain agent and tag it as Sales
.
So, I set the field “Assigned to” to the e-mail of the agent responsible for sales tickets.
Then, I add another action and set the “Tags” field to the Sales
value.
After saving, the trigger is ready for use.
Helpdesk triggers work sequentially. The sequence is defined by the order of the triggers.
For example, when a ticket is created helpdesk runs the triggers in the order:
Notification: All Agents - New ticket
Notification: Requester - New ticket
Notification: Assignee - New ticket
We can change the order by just dragging the triggers in the list.
Similarly, you can order triggers in the Ticket updated and Comment created sections.
Triggers can be exported to JSON files. To do this, click the menu button to the right of a trigger and select “Export”.
To import a trigger, click “Import trigger” near the top of the page.
You will find more useful information about triggers in the following articles: